﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Runtime.Serialization;

namespace Toolkit.Web.ViewComponents.DataGrid
{
    public interface IPersistentDataGridColumnModel
    {
        string Key
        {
            get;
            set;
        }

        int? Width
        {
            get;
            set;
        }

        int? Index
        {
            get;
            set;
        }

        bool IsVisible
        {
            get;
            set;
        }

        IList<IPersistentDataGridColumnFilterModel> Filters
        {
            get;
            set;
        }
    }

    [DataContract]
    public class PersistentDataGridColumnModel : IPersistentDataGridColumnModel
    {
        [DataMember]
        public string Key
        {
            get;
            set;
        }

        [DataMember]
        public int? Width
        {
            get;
            set;
        }

        [DataMember]
        public int? Index
        {
            get;
            set;
        }

        [DataMember]
        public bool IsVisible
        {
            get;
            set;
        }

        [DataMember]
        public IList<IPersistentDataGridColumnFilterModel> Filters
        {
            get;
            set;
        }
    }
}
